package com.module_live.view;

import android.app.Activity;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebView;

import com.module_live.R;
import com.module_live.bean.coachstudy.StudentFinishedWorkBean;
import com.zyyoona7.popup.EasyPopup;

import java.util.ArrayList;
import java.util.List;

public class StudentLuckyDrawPopup {

    private Activity activity;

    public View parentView;

    List<StudentFinishedWorkBean.ObjBean> finishedList = new ArrayList<>();

    public StudentLuckyDrawPopup(Activity activity) {

        this.activity = activity;

        initPopuPopu();
    }

    private EasyPopup popu;


    private void initPopuPopu() {
        popu = EasyPopup.create()
                .setContext(activity)
                .setContentView(R.layout.fragment_study_studentluckydraw)
                .setWidth(WindowManager.LayoutParams.FILL_PARENT)
                .setHeight(WindowManager.LayoutParams.FILL_PARENT)
                .setOnViewListener(new EasyPopup.OnViewListener() {
                    @Override
                    public void initViews(View view, EasyPopup basePopup) {

                        initView(view);

                    }

                })
                .setFocusAndOutsideEnable(true)
                .apply();

    }

    public WebView webView;

    private void initView(View view) {

//        webView = view.findViewById(R.id.webview);

    }

    public void updateLuckyDrawData(String webUrl) {

//        webView.loadUrl(webUrl);
    }

    public void dismiss() {
        popu.dismiss();
    }


    public void showAnswerPopuPopu(View view) {
        popu.showAtLocation(view, Gravity.CENTER, 0, 0);

    }


}
